{% extends 'learning_logs/base.html' %}

{% block page_header %}
    <h3>{{ topic }}</h3>
{% endblock page_header %}


{% block content %}

<p><a href="{% url 'learning_logs:new_entry' topic.id %}">
    添加新内容</a>
</p>
    {% for entry in entries %}

    <div class="card mb-3">
        <h4 class="card-header">
            {{ entry.date_added|date:'M d, Y H:i' }}
            <small><a href="{% url 'learning_logs:edit_entry' entry.id %}">编辑内容</a></small>
            <a class="btn btn-danger btn-xs" href="/entry/delete?nid={{ entry.id }}">删除</a>
        </h4>
        <div class="card-body">
            {{ entry.text|linebreaks }}
        </div>
    </div>
<!--    <li>-->
<!--        <p>{{ entry.date_added|date:'M d, Y H:i' }}</p>-->
<!--        <p>{{ entry.text|linebreaks }}</p>-->
<!--        <p><a href="{% url 'learning_logs:edit_entry' entry.id %}">编辑内容</a></p>-->
<!--        <a class="btn btn-danger btn-xs" href="/entry/delete?nid={{ entry.id }}">删除</a>-->

<!--    </li>-->
    {% empty %}
    <p>该主题还没有条目</p>
    {% endfor %}


{% endblock content %}

